class Bounce {
  static easeIn(e, t, n, r) {
    return n - this.easeOut(r - e, 0, n, r) + t;
  }
  static easeOut(e, t, n, r) {
    return (e /= r) < 1 / 2.75
      ? n * 7.5625 * e * e + t
      : e < 2 / 2.75
      ? n * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
      : e < 2.5 / 2.75
      ? n * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
      : n * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t;
  }
  static easeInOut(e, t, n, r) {
    return e < r / 2
      ? this.easeIn(e * 2, 0, n, r) * 0.5 + t
      : this.easeOut(e * 2 - r, 0, n, r) * 0.5 + n * 0.5 + t;
  }
}

export default Bounce;
